import request from '@/utils/request'

// 获取所有菜单列表
export function allMenuList (params) {
    return request({
        params,
        url: '/back/menu/treeList'
    })
}

// 菜单创建
export function createMenu (data) {
    return request({
        method: 'post',
        data,
        url: '/back/menu/create'
    })
}

// 菜单修改
export function editMenu (id,data) {
    return request({
        method: 'post',
        data,
        url: `/back/menu/update/${id}`
    })
}
// 菜单删除
export function deleteMenu (id) {
    return request({
        method: 'post',
        url: `/back/menu/delete/${id}`
    })
}
// 修改菜单状态

export function editMenuStatus (id,params) {
    return request({
        method: 'post',
        params,
        url: `/back/menu/updateHidden/${id}`
    })
}
// 模糊查询菜单
export function searchMenu (parentId,params) {
    return request({
        params,
        url: `/back/menu/list/${parentId}`
    })
}
// // 获取菜单详情
// export function getMenuDetail (id) {
//     return request({
//         url: `/back/menu/${id}`
//     })
// }